home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / FPSE_src / runtime.c < prev    next >
C/C++ Source or Header  |  2000-01-01  |  707b  |  42 lines

  1. /*
  2.     FPSE runtime functions
  3.     ======================
  4.  
  5.     Written by BERO
  6. */
  7.  
  8. #include "fpse.h"
  9.  
  10. void rfe(void)
  11. {
  12.      SR = (SR & ~0xf)| ((SR>>2)&0xf);
  13.      PRINTF("rfe:%x\n",(int)(SR));
  14. }
  15.  
  16. UINT32 exception(int cd,UINT32 pc)
  17. {
  18. //       if (cd == E_Bp*4) cd = E_Sys*4; // Avoid break opcode
  19.      PRINTF("Exception:%x %x\n",cd,(int)pc);
  20.      EPC=pc;
  21.      //CAUSE = (CAUSE & ~0x3c) | cd;
  22.      CAUSE = cd;
  23.      SR = (SR & ~0x3f)| ((SR<<2)&0x3f);
  24.      return jmppc(0x80000080);
  25. }
  26.  
  27. void compile_go(void)
  28. {
  29.      void (*func)();
  30.      func = (void *)jmppc(PC);
  31.      func();
  32. }
  33.  
  34. void go(void)
  35. {
  36.     int x;
  37.  
  38.     while (!stop) {
  39.         if (update_counter()) Interrupt();
  40.         for (x=0;x<16;x++) doInst();
  41.     }
  42. }